package com.pasabahceambalaj.entity;

// Generated Oct 8, 2013 12:01:41 AM by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Isemirbarkod generated by hbm2java
 */
@Entity
@Table(name = "isemirbarkod", catalog = "ambalaj", uniqueConstraints = @UniqueConstraint(columnNames = { "isemirid", "barkod" }))
public class Isemirbarkod implements java.io.Serializable {

	private Long id;
	private int version;
	private Isemir isemir;
	private String barkodturu;
	private String barkod;

	public Isemirbarkod() {
	}

	public Isemirbarkod(Isemir isemir, String barkodturu, String barkod) {
		this.isemir = isemir;
		this.barkodturu = barkodturu;
		this.barkod = barkod;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "isemirid", nullable = false)
	@NotNull
	public Isemir getIsemir() {
		return this.isemir;
	}

	public void setIsemir(Isemir isemir) {
		this.isemir = isemir;
	}

	@Column(name = "barkodturu", nullable = false, length = 20)
	@NotNull
	@Length(max = 20)
	public String getBarkodturu() {
		return this.barkodturu;
	}

	public void setBarkodturu(String barkodturu) {
		this.barkodturu = barkodturu;
	}

	@Column(name = "barkod", nullable = false)
	@NotNull
	public String getBarkod() {
		return this.barkod;
	}

	public void setBarkod(String barkod) {
		this.barkod = barkod;
	}

}
